package study.java.thread01;


/**
* @Name: ThreadPriorityDemo
* @Description: 线程优先级测试类调用类
* @Author: 李超	lc_jack@foxmail.com
* @CreateDate: 2017-1-8 下午8:39:03 
* @Version: V1.0
 */
public class ThreadPriorityDemo {
	
	public static void main(String[] args) {
		MyThread p1 = new MyThread() ;
		MyThread p2 = new MyThread() ;
		MyThread p3 = new MyThread() ;
		p1.setName("张三丰") ;
		p2.setName("章四风") ;
		p3.setName("东方不败") ;
		//获取系统默认的线程优先级，默认为5
//		System.out.println(p1.getPriority());
//		System.out.println(p2.getPriority());
//		System.out.println(p3.getPriority());
		//设置线程的优先级1-10
		p1.setPriority(Thread.MAX_PRIORITY) ;
//		=p1.setPriority(10) ;
		p2.setPriority(Thread.NORM_PRIORITY) ;
//		=p2.setPriority(5) ;
		p3.setPriority(Thread.MIN_PRIORITY) ;
//		=p3.setPriority(1) ;
		p1.start() ;
		p2.start() ;
		p3.start() ;
	}

}
